#pragma once
#include "fxcc/core/graph/common/AnimTransition.h"
#include "fxcc/core/graph/common/AnimationNode.h"
#include "fxcc/core/graph/common/Condition.h"

namespace fxcc::graph::common
{

	struct StartAnimNode :public fxcc::Base
	{
		int m_StartOutPin;

		StartAnimNode()
		{
			m_StartOutPin = fxcc::Base::generateIDFromTime();
		}
	};

	struct AnimationController :public fxcc::Base
	{
		std::map<int, AnimationNode> m_AnimationNodes;
		
		std::map<int, AnimTransition> m_AnimTransitions;
		
		Params m_Params;

		int m_StartAnimId{0};

		int m_AnimId{0};

		int m_TransitionId{0};

		StartAnimNode m_StartAnimNode;

		bool m_TransitionWorking{ 0 };

		bool UpdateEntityMap(float deltaTime);

		bool UpdateEntityMapAnim(float deltaTime);

		bool UpdateEntityMapTransition(float deltaTime);

		bool SetEntityMap();

		bool SetEntityMapAnim();

		bool SetEntityMapTransition();

		//void OnLoad(e2d::Entity* entity);

		bool HasAnim(const int& id);

		bool HasTransition(const int& id);

		const std::vector<int> AllAnimIds() const;
		
		const std::vector<int> AllTransitionIds() const;

	};
};